Optimal. Leaf size=67 \[ \frac{3}{2} i \text{PolyLog}\left (2,-i e^{i x}\right )-\frac{3}{2} i \text{PolyLog}\left (2,i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \tan (x) \sec (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.137247, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 19, number of rules used = 6, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.6, Rules used = {4431, 4181, 2279, 2391, 4413, 4185} \[ \frac{3}{2} i \text{PolyLog}\left (2,-i e^{i x}\right )-\frac{3}{2} i \text{PolyLog}\left (2,i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \tan (x) \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4431
Rule 4181
Rule 2279
Rule 2391
Rule 4413
Rule 4185
Rubi steps
\begin{align*} \int x \cos (2 x) \sec ^3(x) \, dx &=\int \left (x \sec (x)-x \sec (x) \tan ^2(x)\right ) \, dx\\ &=\int x \sec (x) \, dx-\int x \sec (x) \tan ^2(x) \, dx\\ &=-2 i x \tan ^{-1}\left (e^{i x}\right )-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx+\int x \sec (x) \, dx-\int x \sec ^3(x) \, dx\\ &=-4 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)+i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )-\frac{1}{2} \int x \sec (x) \, dx-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+i \text{Li}_2\left (-i e^{i x}\right )-i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)+i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )+\frac{1}{2} \int \log \left (1-i e^{i x}\right ) \, dx-\frac{1}{2} \int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+2 i \text{Li}_2\left (-i e^{i x}\right )-2 i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)-\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )+\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{3}{2} i \text{Li}_2\left (-i e^{i x}\right )-\frac{3}{2} i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)\\ \end{align*}
Mathematica [B] time = 0.27406, size = 146, normalized size = 2.18 \[ \frac{1}{4} \left (6 i \text{PolyLog}\left (2,-i e^{i x}\right )-6 i \text{PolyLog}\left (2,i e^{i x}\right )+6 x \log \left (1-i e^{i x}\right )-6 x \log \left (1+i e^{i x}\right )+\frac{x}{\sin (x)-1}+\frac{x}{\left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )^2}+\frac{2 \sin \left (\frac{x}{2}\right )}{\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )}-\frac{2 \sin \left (\frac{x}{2}\right )}{\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.223, size = 102, normalized size = 1.5 \begin{align*}{\frac{i \left ( x{{\rm e}^{3\,ix}}-x{{\rm e}^{ix}}-i{{\rm e}^{3\,ix}}-i{{\rm e}^{ix}} \right ) }{ \left ({{\rm e}^{2\,ix}}+1 \right ) ^{2}}}-{\frac{3\,x\ln \left ( 1+i{{\rm e}^{ix}} \right ) }{2}}+{\frac{3\,x\ln \left ( 1-i{{\rm e}^{ix}} \right ) }{2}}+{\frac{3\,i}{2}}{\it dilog} \left ( 1+i{{\rm e}^{ix}} \right ) -{\frac{3\,i}{2}}{\it dilog} \left ( 1-i{{\rm e}^{ix}} \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.538735, size = 500, normalized size = 7.46 \begin{align*} \frac{3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) - 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (i \, \cos \left (x\right ) + \sin \left (x\right )\right ) - 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (i \, \cos \left (x\right ) - \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (-i \, \cos \left (x\right ) + \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (-i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - 2 \, x \sin \left (x\right ) + 2 \, \cos \left (x\right )}{4 \, \cos \left (x\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x \cos \left (2 \, x\right ) \sec \left (x\right )^{3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]